﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Dundas.Charting.WebControl;
using System.Collections;
using Meqs.Entity;
using System.Collections.Generic;

public partial class Student_Report_HistoryChart : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (this.Session["ChartData" + CommonScore.LogonStudent.RID] != null)
            {
                List<HistoryPosition> hps = Session["ChartData" + CommonScore.LogonStudent.RID] as List<HistoryPosition>;
                Chart1.Series.Clear();
                ChartArea area = Chart1.ChartAreas[0];
                area.AxisX.Title = "考试时间";
                area.AxisY.Title = "排名";
                area.AxisY.RoundAxisValues();
                area.AxisY.Reverse = true;

                foreach(HistoryPosition h in hps)
                {
                    Series series = Chart1.Series.Add(h.TitleName);
                    series.Type = SeriesChartType.Line;
                    series.MarkerStyle = MarkerStyle.Circle;
                    series.BorderWidth = 2;
                    series.Points.DataBindXY(h.ForX, h.ForY);

                    //Series series = Chart1.Series.Add(h.TitleName);
                    //series.Type = SeriesChartType.BoxPlot;

                    //series.Color = Color.FromArgb(0x22ff0f0f);
                    //for (int i = 0; i < 2; i++)
                    //{
                    //    h.ForX.Add("a" + i);
                    //    h.ForY.Add(i);
                    //}
                    //series.ShowLabelAsValue = true;
                    //series.MarkerStyle = MarkerStyle.Circle;
                    //series.BorderWidth = 10;
                    //series.Points.DataBindXY(h.ForX, h.ForY);

                }
                //Chart1.ImageType = ChartImageType.Png;
                //Chart1.Save("c:\\" + "11.png");
               
            }
        }
    }
}
